using System;
using System.Collections.Generic;

using TnPlus.Entities.Utils;
using TnPlus.Entities.Models;
using TnPlus.DAL;
using TnPlus.Common;

namespace TnPlus.Biz
{
	public class PortfolioTodayService
	{
		/// <summary>
		/// Saves a record to the PortfolioToday table.
		/// </summary>
		public virtual void Insert(PortfolioTodayInfo portfolioTodayInfo)
		{
			try
			{
				new PortfolioTodayDAO().Insert(portfolioTodayInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.PortfolioToday - Insert", ex);
				throw;
			}

		}

		/// <summary>
		/// Saves a record to the PortfolioToday table.
		/// </summary>
		public virtual void Update(PortfolioTodayInfo portfolioTodayInfo)
		{
			try
			{
				new PortfolioTodayDAO().Update(portfolioTodayInfo);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.PortfolioToday - Update", ex);
				throw;
			}

		}

		/// <summary>
		/// Delete a record from the PortfolioToday table.
		/// </summary>
		public virtual void Delete(Guid? idPortfolio)
		{
			try
			{
				new PortfolioTodayDAO().Delete(idPortfolio);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.PortfolioToday - Delete", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects a single record from the PortfolioToday table.
		/// </summary>
		public virtual PortfolioTodayInfo Select(Guid? idPortfolio)
		{
			try
			{
				return new PortfolioTodayDAO().Select(idPortfolio);
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.PortfolioToday - Select", ex);
				throw;
			}

		}

		/// <summary>
		/// Selects all records from the PortfolioToday table.
		/// </summary>
		public List<PortfolioTodayInfo> SelectAll()
		{
			try
			{
				return new PortfolioTodayDAO().SelectAll();
			}
			catch (Exception ex)
			{
				Logger.Error("TnPlus.Biz.PortfolioToday - SelectAll", ex);
				throw;
			}

		}

	}
}
